<h3>评论</h3>
<hr>
<div class="post_commt">
	<div class="commt_l">
		<form id="commtform">
			<input type="hidden" name="parentid" value="<?php echo $model->
			id ?>">
			<div class="info">
				<div class="textarea_wraper">
					<textarea name="content" title="请输入评论内容" placeholder="请输入评论内容" rows="5" id="commtcontent"></textarea>
				</div>
				<div class="commt_sub">
					<span class="seccode_box">
						验证码：
						<input class="form_input" name="code" type="text" title="请输入验证码" align="absmiddle" id="code">
						<?php $this->
						widget('CCaptcha',array('showRefreshButton'=>false,'clickableImage'=>true,'imageOptions'=>array('alt'=>'点击换图','title'=>'点击换图','style'=>'cursor:pointer'))); ?>
					</span>
					<span class="fontsline" id="post_tips"> <ins>还可以输入 <strong>320</strong>
							字</ins> 
					</span>

					<div style="text-align:right;padding:5px 0px">
						<input id="post_btn" type="button" class="button blue" value="评论" ></div>

				</div>
			</div>
		</form>
	</div>
	<div class="clear"></div>
</div>
<div class="commt_list">
	<nav>
		<span class="new_cmnt">最新评论</span>
	</nav>
	<div id="J_commt_list"></div>
</div>
<a href="javascript:;"  class="article_more" style="display:none;" id="comment-more">查看更多>></a>
<script type="text/template" id="comment-template">
	<dl>
			<dt>
				<span class="re_username">匿名人士</span>
				<span class="datetime">发表于 {{jsDateDiff(createtime)}}</span>
			</dt>
			<dd class="comment_avatars">
				<img width="54px" height="54px" onerror="this.src='<?php echo Yii::app()->
				request->baseurl ?>/images/anonymous.gif'" src="
				<?php echo Yii::app()->request->baseurl ?>/images/anonymous.gif"></dd>
			<dd class="comment_body">
				<div id="J_Comment_Quote_7697317"></div>
				<div class="re_text">{{content}}</div>
				<div class="re_mark">
					<span>
						<a class="commt_a_link" supported="false" action-type="support" href="javascript:;" title="支持">
							<span>支持({{supports}})</span>
						</a>
						<a class="commt_a_link" againsted="false" action-type="against" href="javascript:;" title="反对">
							<span>反对({{opposition}})</span>
						</a>
						<a class="commt_a_link" href="javascript:;" action-type="reply">
							<span>回复</span>
						</a>
					</span>
				</div>
			</dd>
		</dl>
</script>
<?php
	$cs = Yii::app()->clientScript;
	$cs->registerScriptFile(Yii::app()->params['static'].'/js/underscore-min.js',CClientScript::POS_END);
	$cs->registerScriptFile(Yii::app()->params['static'].'/js/article-view.js',CClientScript::POS_END);
	$cs->registerScriptFile(Yii::app()->params['static'].'/js/loadMore.js',CClientScript::POS_END);
?>
<script type="text/javascript">
	$(function(){
			LoadMore({
				template:'comment-template',
				el:'J_commt_list', 
				btn:'comment-more',
				url:'<?php echo $this->createUrl("Comment/List",array("id"=>$model->id)) ?>',
				pagecount:<?php echo $model->comments ?>,
				pagesize:<?php echo Yii::app()->params['comment_pagesize'] ?>,
				lazyload:true,
			});

			ajaxcommt({
				 	form:$("#commtform"),
				 	message:$("#post_tips"),
				 	content:$("#commtcontent"),
				 	submitbtn:$("#post_btn"),
				 	code:$("#code"),
				 	comments:$("#J_commt_list"),
				 	url:"<?php echo $this->createUrl('Comment') ?>"
		 	});
			  
	});
</script>
